package com.songshuai.sales.client.feign;


import com.songshuai.webapi.baseapi.dto.feign.request.pangu.salemeeting.QueryCustomersReqDto;
import com.songshuai.webapi.baseapi.dto.feign.request.pangu.salemeeting.SendInvitationReqDto;
import com.songshuai.webapi.baseapi.dto.feign.request.pangu.salemeeting.TalkNotesReqDto;
import com.songshuai.webapi.baseapi.dto.feign.response.DictionaryDto;
import com.songshuai.webapi.baseapi.dto.feign.response.pangu.salemeeting.*;
import com.songshuai.webapi.baseapi.dto.pangu.request.salesclient.CustomerListReqDto;
import com.songshuai.webapi.baseapi.dto.pangu.request.service.AddInviteServiceItemReqDto;
import com.songshuai.webapi.baseapi.dto.pangu.request.service.ServiceReqDto;
import com.songshuai.webapi.baseapi.dto.pangu.response.salesclient.CustomerInfoDto;
import com.songshuai.webapi.baseapi.dto.pangu.response.service.InviteServiceItemTreeResDto;
import com.songshuai.webapi.baseapi.enumerations.ResultStatus;
import com.songshuai.webapi.baseapi.model.sales.SalesInfo;
import com.songshuai.webapi.baseapi.pojo.BaseParmDto;
import com.songshuai.webapi.baseapi.pojo.QueryPageRes;
import com.songshuai.webapi.baseapi.pojo.QueryResponse;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;
import java.util.List;

@Component
public class PanguApiClientFallback implements PanguApiClient{
    @Override
    public SalesInfo queryUserById(String id) {

        return new SalesInfo();
    }
    @Override
    public QueryResponse<List<CustomerInfoDto>> getCustomerList(BaseParmDto<CustomerListReqDto> request) {

        return new QueryResponse(ResultStatus.HTTP_STATUS_REQUEST_TIMEOUT);
    }

    @Override
    public QueryResponse<List<MeetingListResDto>> queryMeetingList(Integer type, String userId) {
        MeetingListResDto meetingListResDto=new MeetingListResDto();
        return QueryResponse.setResData(new ArrayList().add(meetingListResDto));
    }

    @Override
    public QueryResponse<List<CustomerListResDto>> queryCustomerList(String userId, String code) {
        CustomerListResDto customerListResDto=new CustomerListResDto();
//        customerListResDto.setCustomerName("haha");
//        customerListResDto.setCustomerGuid(1l);
//        customerListResDto.setMeetingNo("fdfsdfds");
        return QueryResponse.setResData(new ArrayList().add(customerListResDto));
    }

    @Override
    public QueryResponse<List<InvitationLetterResDto>> queryInvitationLetter(String code) {
        InvitationLetterResDto invitationLetterResDto=new InvitationLetterResDto();
        return QueryResponse.setResData(new ArrayList().add(invitationLetterResDto));
    }

    @Override
    public QueryResponse<QueryPageRes<List<CustomerInfosResDto>>> queryCustomers(BaseParmDto<QueryCustomersReqDto> request) {
        CustomerInfosResDto customerInfosResDto=new CustomerInfosResDto();
        List<CustomerInfosResDto> list=new ArrayList();
        list.add(customerInfosResDto);
        return QueryResponse.setResData(QueryPageRes.setPageData(list,0L));
    }

    @Override
    public QueryResponse sendInvitation(SendInvitationReqDto request) {

        return new QueryResponse(ResultStatus.HTTP_STATUS_REQUEST_TIMEOUT);
    }


    @Override
    public QueryResponse<ReceiptInfoResDto> queryReceipt(String inviteNo) {
        return QueryResponse.setResData(new ReceiptInfoResDto());
    }


    @Override
    public QueryResponse<List<SalesManInfoResDto>> querySalesInfo(String userId) {
        SalesManInfoResDto salesManInfoResDto=new SalesManInfoResDto();
        return QueryResponse.setResData(new ArrayList<>().add(salesManInfoResDto));
    }

    @Override
    public QueryResponse<Boolean> handOverCustomer(String userId, List<Long> cluesIds, List<Integer> saleIds) {
        return QueryResponse.setResData(false,ResultStatus.HTTP_STATUS_REQUEST_TIMEOUT);
    }

    @Override
    public QueryResponse<Boolean> talkNotes(TalkNotesReqDto request) {
        return QueryResponse.setResData(false,ResultStatus.HTTP_STATUS_REQUEST_TIMEOUT);
    }

    @Override
    public QueryResponse<List<DictionaryDto>> queryDictionariesByType(Integer type) {
        DictionaryDto dictionaryDto=new DictionaryDto();
        return QueryResponse.setResData(new ArrayList<>().add(dictionaryDto));
    }


    @Override
    public QueryResponse<DictionaryDto> queryDictionaryDetail(Integer id) {

        return QueryResponse.setResData(new DictionaryDto());
    }

    @Override
    public QueryResponse uploadPicture(MultipartFile file, Integer imgMaxSize, String basePath, String imgPath) {

        return new QueryResponse(ResultStatus.ERROR_PIC_UPLOAD);
    }

    @Override
    public QueryResponse uploadPictureOss(MultipartFile file) {
        return new QueryResponse(ResultStatus.ERROR_PIC_UPLOAD);
    }

    @Override
    public QueryResponse<List<InviteServiceItemTreeResDto>> getAllServiceList() {
        return QueryResponse.setResData(new ArrayList<>().add(new InviteServiceItemTreeResDto()));
    }

    @Override
    public QueryResponse<List<String>> getInviteServiceItems(ServiceReqDto reqDto) {
        return QueryResponse.setResData(new ArrayList<>().add(""));
    }

    @Override
    public QueryResponse<Boolean> addInviteServiceItem(AddInviteServiceItemReqDto reqDto) {
        return QueryResponse.setResData(new ArrayList<>().add(false));
    }

    @Override
    public QueryResponse<List<CommunicateListResDto>> getCommunicateList(Long clueGuid) {
        return QueryResponse.setResData(new ArrayList<>().add(new CommunicateListResDto()));
    }

}
